package com.shared.server.impl;

import com.shared.dao.PGoodsCartMapper;
import com.shared.pojo.PGoodsCart;
import com.shared.server.PGoodsCartServer;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class PGoodsCartServerImpl implements PGoodsCartServer {

    @Autowired
    private PGoodsCartMapper pGoodsCartMapper;

    @Override
    public List<PGoodsCart> findCartByUserId(Integer userid) {
        return pGoodsCartMapper.findCartByUserId(userid);
    }

    @Override
    public void deleteCartById(Integer id) {
        this.pGoodsCartMapper.deleteCartById(id);
    }

    @Override
    public void addCart(PGoodsCart pGoodsCart) {
        this.pGoodsCartMapper.addGoodsCart(pGoodsCart);
    }

    @Override
    public void updateCartNumberById(Integer id, Integer count) {
        this.pGoodsCartMapper.updateCartNumberById(id, count);
    }

}
